package cn.tedu.javagame.shoot;

import java.awt.*;

public abstract class FlyObject {
    int x,y;
    int speed;
    Image img;
    Image[] imgs;
    //抽象类是不能实例化的，只能实例化其子类
    public FlyObject(){
        this.speed = (int)(Math.random()*5+2);
    }
    public abstract void move();
    int index = -1;
    public void step(){
        index++;
        if(index==Integer.MAX_VALUE){index=-1;}
        this.img = this.imgs[index++/10%this.imgs.length];
    }
}